import request from '../utils/request'
// 这个data里面需要携带code部门编码，同级部门不可重复	 introduce介绍   manager负责人名称	 name部门名称   pid父级部门ID
// 新增部门
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 获取所有部门
export function getDepartments() {
  return request({
    url: '/company/department',
    method: 'get'
  })
}

// 根据ID修改部门详情
export function updataDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}

// 根据ID删除部门
export function delDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

// 根据ID查询部门详情
export function getdataDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'get'
  })
}
